how to test java code in terminal